import {
	createI18n,
	registerMessageResolver, // register the message resolver API
	registerLocaleFallbacker // register the locale fallbacker API
} from 'petite-vue-i18n'
import {
	resolveValue, // message resolver of vue-i18n which is used by default
	fallbackWithLocaleChain // locale fallbacker of vue-i18n which is used by default
} from '@intlify/core-base'
import messages from '@intlify/unplugin-vue-i18n/messages'

// register message resolver of vue-i18n
registerMessageResolver(resolveValue)

// register locale fallbacker of vue-i18n
// @ts-ignore
registerLocaleFallbacker(fallbackWithLocaleChain)

const i18n = createI18n({
	locale: 'en',
	messages,
	fallbackLocale: 'en'
})

export default i18n
